package com.example.wei;

import android.app.Application;
import android.util.Log;

import com.example.wei.view.PullRefreshViewHelper;

public class MyApp extends Application {
    private  static  MyApp instance= null;
    public  static MyApp get(){
        return  instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance =this;
        Log.i("TAGS","MyApp");

        PullRefreshViewHelper.get().init(14);
        PullRefreshViewHelper.get().setColors(getColors(R.color.teal_700), getColors(R.color.teal_200));
        PullRefreshViewHelper.get().setLoadStyle(PullRefreshViewHelper.LOAD_STYLE_WAVE);
        PullRefreshViewHelper.get().setLoadColor(getColors(R.color.teal_700));
        PullRefreshViewHelper.get().setLoadText("加载中...");
        PullRefreshViewHelper.get().setEmptyImage(R.mipmap.ic_pull_refresh);
        PullRefreshViewHelper.get().setEmptyColor(getColors(R.color.teal_700));
        PullRefreshViewHelper.get().setEmptyText("暂无数据~");
        PullRefreshViewHelper.get().setErrorImage(R.mipmap.ic_pull_refresh);
        PullRefreshViewHelper.get().setErrorColor(getColors(R.color.teal_700));
        PullRefreshViewHelper.get().setErrorText("加载失败了~");

    }
    public int getColors(int id) {

        return getResources().getColor(id);

    }

}
